Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.
Example 1:
Input: s = "Hello"
Output: "hello"
Example 2:
Input: s = "here"
Output: "here"
Example 3:
Input: s = "LOVELY"
Output: "lovely"
解題思路
這題要求把字串中的所有大寫字母轉換成小寫字母。
1.內建方法toLowerCase()
或手動轉換:若字元在'A'到'Z'之間,轉成 (char)(c + 32)。
ASCII:
'A' = 65
'a' = 97
小寫字母比大寫多32